<?php

use yii\helpers\Html;
use app\core\lib\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Menu */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="box-body">
    <?php $form = ActiveForm::begin([
            'options' => ['class' => 'form-horizontal'],
            'fieldConfig' => [
            'template' => "{label}\n<div class=\"col-lg-8\">{input}</div>\n<div class=\"col-lg-2\">{error}</div>",
            'labelOptions' => ['class' => 'col-lg-1 control-label'],
        ],
    ]); ?>

          <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

      <?= $form->field($model, 'pid')->dropDownList([0 => '一级菜单'] + \app\models\Menu::treeArr(), ['encode' => false])  ?>

      <?= $form->field($model, 'sort')->textInput() ?>

      <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>

      <?= $form->field($model, 'hide')->textInput() ?>

      <?= $form->field($model, 'icon_style')->textInput(['maxlength' => true]) ?>


    <?= Html::submitButton(Html::tag('span', '', ['class' => 'glyphicon glyphicon-floppy-disk']) . ' ' .
    ($model->isNewRecord ? 'Create' : 'Save'),
    ['class' => $model->isNewRecord ? 'btn btn-success pull-right' : 'btn btn-primary pull-right']) ?>
    <?php ActiveForm::end(); ?>
</div>
<?php $this->render('@app/modules/admin//views/layouts/modal-form', ['form'=>$form])?>

